From 69d563c720e56a213c874c51516526fe4d78af20 Mon Sep 17 00:00:00 2001 From: cegger Date: Mon, 28 Feb 2011 12:21:49 +0100 Subject: [PATCH] Allow paged real mode during vmrun emulation. Emulate cr0 and cr4 when guest does not intercept them. Signed-off-by: Christoph Egger Acked-by: Eddie Dong Acked-by: Tim Deegan Committed-by: Tim Deegan --- xen/arch/x86/hvm/hvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 1d7db47dd1..d52b4f8659 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -1335,7 +1336,8 @@ int hvm_set_cr0(unsigned long value) /* ET is reserved and should be always be 1. */ value |= X86_CR0_ET; - if ( (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG ) + if ( !nestedhvm_vmswitch_in_progress(v) && + (value & (X86_CR0_PE | X86_CR0_PG)) == X86_CR0_PG ) goto gpf; if ( (value & X86_CR0_PG) && !(old_value & X86_CR0_PG) ) -- 2.30.2